<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js的执行顺序</title>
    <script src="./1.js"></script>
    <script async src="./2.js"></script>
    <link href="./base.css" rel="stylesheet" type="text/css" />
    <script>
        console.log('head中的js');

        // var hello = function() {
        //     alert('大伟1');
        // }
        // hello();
        // var hello = function() {
        //     alert('大伟2');
        // }
        // hello();

        function hello() {
            alert('大伟1');
        }
        hello();
        </script>
        <script>
        function hello() {
            alert('大伟2');
        }
        hello();

    </script>
</head>
<body>
    <script>
        console.log('body中的js');
    </script>
    <div>大伟聊前端</div>
    <div>大伟聊前端</div>
    <div>大伟聊前端</div>
    <div>大伟聊前端</div>
    <div>大伟聊前端</div>
    <div>大伟聊前端</div>
    <div>大伟聊前端</div>
    <div>大伟聊前端</div>
    <div>大伟聊前端</div>
    <div>大伟聊前端</div>
    <script>
        window.onload = function () {
            console.log('body onload中的方法');
        }
    </script>
</body>
</html>
<script>
    console.log('HTML外的的js');
</script>